
#########################################
#             CHILLINSTALL              #
#########################################


# GETTING STARTED
# --------------- 
#   1 - Adapt the script with your preferences, the software you want, etc.
#   2 - Open a terminal in the chillinstall directory and type "sudo ./chillinstall.sh"
#   3 - Optional: Get a beer.

# DISCLAIMER
# ----------
#    - This script has been written for Ubuntu 10.04, you might have to adapt it for your distribution.
#    - This script does NOT comes with any warranty of any kind.

# TROUBLESHOOTING
# ---------------
#   Check your internet connection for the softwares' updates and installations. 


#########################################
#             PARAMETERS                #
#########################################

WALLPAPER="Kane - Le Phare Amedee Lighthouse.jpg"
LOGIN_PIC="Neo.face"
MUSIC_LIBRARY="file:///media/FIOT/Music"
SOUND_THEME="alien4"


#########################################
#     REMOVE UNWANTED APPLICATIONS      #
#########################################

# Remove games
sudo apt-get remove -y aisleriot glchess glines gnect gnibbles gnobots2 gnome-mahjongg gnome-sudoku gnomine gnotravex gnotski gtali iagno gbrainy quadrapassel 

# Remove XSANE (scan, copy and fax tool)
sudo apt-get -y remove xsane 

# Remove Evolution
sudo apt-get remove -y evolution

#########################################
#          UPDATE APPLICATIONS          #
#########################################

# Update & update
sudo apt-get update
sudo apt-get -y upgrade

# Autoremove
sudo apt-get -y autoremove


#########################################
#           GNOME EXTENSIONS            #
#########################################

# Open-in-terminal extension for Gnome
sudo apt-get -y install nautilus-open-terminal


#########################################
#          INSTALL APPLICATIONS         #
#########################################

# Programming tools
sudo apt-get -y install eclipse
sudo apt-get -y install geany geany-plugins
sudo apt-get -y install g++
sudo apt-get -y install subversion
sudo apt-get -y install cmake cmake-curses-gui
sudo apt-get -y install libboost-all-dev

# LaTeX and Bibliographic tools
sudo apt-get -y install texlive
sudo apt-get -y install texlive-full
sudo apt-get -y install jabref
sudo apt-get -y install geany-plugin-latex
sudo apt-get -y install latexdiff

# Libraries
sudo apt-get -y install python-wxgtk2.8
sudo apt-get -y install python-nifti

# Multimedia
sudo apt-get -y install vlc
sudo apt-get -y install imagemagick

# Hacking
sudo apt-get -y install aircrack-ng macchanger

# System tools
sudo apt-get -y install htop

# Archiver
sudo apt-get -y install rar

# Internet
sudo apt-get -y install tucan
sudo apt-get install libqt4-network && sudo dpkg -i skype-ubuntu-intrepid_2.1.0.47-1_i386.deb
mkdir ~/Software
cp Skype.sh ~/Software #This script contains a patch for the webcam support.
sudo apt-get -y install mimms # mimms is an mms (e.g. mms://) stream downloader

## Utilities for Dell Laptops
#sudo apt-get -y install i8kutils gkrellm-i8k

# Medical Imaging
sudo apt-get -y install fsl
sudo apt-get -y install libinsighttoolkit3-dev
sudo apt-get -y install libvtk5-dev
sudo apt-get -y install libgdcm2-dev
sudo apt-get -y install libvtkgdcm2-dev
sudo apt-get -y install mricron


# Korean and hangeul support
sudo apt-get -y install scim-hangul
sudo apt-get -y install language-support-fonts-ko language-support-input-ko language-pack-ko language-pack-gnome-ko language-pack-ko-base language-pack-gnome-ko-base libreoffice-l10n-ko firefox-locale-ko

#########################################
#             CUSTOMISATION             #
#########################################

# Colour Prompt

echo " " >> ~/.bashrc
echo "export PS1='\[\e[36;2m\]\@ \[\e[31;1m\]\u\[\e[35;1m\]@\[\e[36;1m\]\H\[\e[35;1m\]:\w\[\e[31;1m\]$\[\e[0m\] '" >> ~/.bashrc
echo "# Colour codes here: http://www.pantz.org/software/shell/enhancingshellprompt.html" >> ~/.bashrc

echo " " >> /root/.bashrc
echo "export PS1='\[\e[36;2;47m\]\@ \[\e[31;1m\]\u\[\e[35;2m\]@\[\e[36;2m\]\H\[\e[35;2m\]:\w\[\e[31;1m\]\$\[\e[0m\] '" >> /root/.bashrc
echo "# Colour codes here: http://www.pantz.org/software/shell/enhancingshellprompt.html" >> /root/.bashrc


#########################################
#     GNOME CONFIGURATION SETTINGS      #
#########################################

# This part is originally derived from  Adam Olsen (synic)'s script (source: http://www.vimtips.org/2009/08/02/gnome-configuration-settings/)
# Please refer to http://www.gnome.org/~bmsmith/gconf-docs/C/ for more options

# Update Notifier
gconftool -s --type bool /apps/update-notifier/auto_launch true

# Metacity
gconftool -s --type int /apps/metacity/general/num_workspaces 4
gconftool -s --type string /apps/metacity/general/action_double_click_titlebar toggle_maximise # toggle_shade
gconftool -s --type string /apps/metacity/global_keybindings/switch_to_workspace_1 "disabled" # "<Control>F1"
gconftool -s --type string /apps/metacity/global_keybindings/switch_to_workspace_2 "disabled" # "<Control>F2"
gconftool -s --type string /apps/metacity/global_keybindings/switch_to_workspace_3 "disabled" # "<Control>F3"
gconftool -s --type string /apps/metacity/global_keybindings/switch_to_workspace_4 "disabled" # "<Control>F4"
gconftool -s --type string /apps/metacity/global_keybindings/run_command_terminal "<Control><Alt>T"

## Nautilus
#gconftool -s --type string /apps/nautilus/icon_view/default_zoom_level standard # options: smallest, smaller, small, standard, large, larger, largest
#gconftool -s --type bool /apps/nautilus/desktop/computer_icon_visible false
#gconftool -s --type bool /apps/nautilus/desktop/home_icon_visible false
#gconftool -s --type bool /apps/nautilus/desktop/network_icon_visible false
#gconftool -s --type bool /apps/nautilus/desktop/trash_icon_visible false

# Gnome 
gconftool -s --type string /desktop/gnome/interface/toolbar_style both

# Fonts
gconftool -s --type string /apps/nautilus/preferences/desktop_font "Sans 10"
gconftool -s --type string /apps/metacity/general/titlebar_font "Sans Bold 10"
gconftool -s --type string /desktop/gnome/interface/monospace_font_name "Monospace 10"
gconftool -s --type string /desktop/gnome/interface/document_font_name "Sans 10"
gconftool -s --type string /desktop/gnome/interface/font_name "Sans 10"

# Gnome Terminal
gconftool -s --type bool /apps/gnome-terminal/profiles/Default/allow_bold true
gconftool -s --type bool /apps/gnome-terminal/profiles/Default/use_theme_colors false
gconftool -s --type bool /apps/gnome-terminal/global/confirm_window_close false
gconftool -s --type string /apps/gnome-terminal/profiles/Default/foreground_color '#FFFFFFFFFFFF'
gconftool -s --type string /apps/gnome-terminal/profiles/Default/background_color '#000000000000'
gconftool -s --type float /apps/gnome-terminal/profiles/Default/background_darkness '0.8' # Transparency = 1 - Darkness
gconftool -s --type string /apps/gnome-terminal/profiles/Default/palette "#000000000000:#AAAA00000000:#0000AAAA0000:#AAAA55550000:#00000000AAAA:#AAAA0000AAAA:#0000AAAAAAAA:#AAAAAAAAAAAA:#555555555555:#FFFF55555555:#5555FFFF5555:#FFFFFFFF5555:#55555555FFFF:#FFFF5555FFFF:#5555FFFFFFFF:#FFFFFFFFFFFF"
gconftool -s --type string /apps/gnome-terminal/profiles/Default/scrollbar_position hidden
gconftool -s --type bool /apps/gnome-terminal/profiles/Default/default_show_menubar false

# Wallpaper
cp "$WALLPAPER" ~/Pictures/
gconftool -s --type string /desktop/gnome/background/picture_filename "/home/`whoami`/Pictures/$WALLPAPER"
gconftool -s --type string /desktop/gnome/background/picture_options "stretched"

# Screensaver
gconftool -s --type string /apps/gnome-screensaver/mode "single"
gconftool -s --type list --list-type=string /apps/gnome-screensaver/themes [screensavers-fiberlamp] # [screensavers-glmatrix]

# Login Picture
cp "$LOGIN_PIC" ~/.face

# Rythmbox # TODO: Replace with Banshee stuff
#gconftool -s --type bool /apps/rhythmbox/plugins/jamendo/active false
#gconftool -s --type bool /apps/rhythmbox/plugins/magnatune/active false
#gconftool -s --type bool /apps/rhythmbox/plugins/lyrics/active true
#gconftool -s --type list --list-type=string /apps/rhythmbox/library_locations [$MUSIC_LIBRARY]
#gconftool -s --type bool /apps/rhythmbox/monitor_library true
#gconftool -s --type string /apps/rhythmbox/ui/rhythmdb_columns_setup "RHYTHMDB_PROP_DURATION,RHYTHMDB_PROP_DATE,RHYTHMDB_PROP_ALBUM,RHYTHMDB_PROP_ARTIST,RHYTHMDB_PROP_TRACK_NUMBER,RHYTHMDB_PROP_POST_TIME"

# Sound Theme
sudo rm -r /usr/share/sounds/$SOUND_THEME
sudo cp -r $SOUND_THEME /usr/share/sounds
sudo chmod ugo+xr /usr/share/sounds/$SOUND_THEME
gconftool -s --type string /desktop/gnome/sound/theme_name $SOUND_THEME
gconftool -s --type bool /desktop/gnome/sound/event_sounds true


# Gnome Panel Launchers
#  -> TODO (see /apps/panel/objects in gconf-editor)

# Metacity Theme
#  -> TODO

# Firefox
#  -> TODO (see ~/.mozilla/firefox/)


#########################################
#            PATH IN ~./bashrc          #
#########################################

# Get software directory
CURRENT_DIR=$(pwd)
SOFTWARE_DIR="$CURRENT_DIR/.."

# C3D
echo " "  >> ~/.bashrc
echo "PATH=\$PATH:$SOFTWARE_DIR/c3d/bin" >> ~/.bashrc

# MRICRO
echo " "  >> ~/.bashrc
echo "#### MRICRO PATCH - BEGIN" >> ~/.bashrc
echo "PATH=\$PATH:$SOFTWARE_DIR/mricro/mricro" >> ~/.bashrc
echo "if [ -n "\$LD_LIBRARY_PATH" ]; then" >> ~/.bashrc
echo "  export LD_LIBRARY_PATH="$SOFTWARE_DIR/mricro/mricro:\$LD_LIBRARY_PATH"" >> ~/.bashrc
echo "else" >> ~/.bashrc
echo "  export LD_LIBRARY_PATH="$SOFTWARE_DIR/mricro/mricro"" >> ~/.bashrc
echo "fi" >> ~/.bashrc
echo "#### MRICRO PATCH - END" >> ~/.bashrc

# ANTS
echo " "  >> ~/.bashrc
echo "PATH=\$PATH:$SOFTWARE_DIR/ANTS/bin" >> ~/.bashrc
